package com.mall.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.dubbo.mapper.PmsProductFullReductionMapper;
import com.mall.model.domain.PmsProductFullReduction;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xyiaao
 * @description 针对表【pms_product_full_reduction(产品满减表(只针对同商品))】的数据库操作Api实现
 * @createDate 2022-03-29 19:46:09
 */
@DubboService
public class PmsProductFullReductionApiImpl extends ServiceImpl<PmsProductFullReductionMapper, PmsProductFullReduction>
        implements PmsProductFullReductionApi {

    @Autowired
    private PmsProductFullReductionMapper productFullReductionMapper;

    @Override
    public List<PmsProductFullReduction> findByProductId(Integer id) {

        LambdaQueryWrapper<PmsProductFullReduction> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(PmsProductFullReduction::getProductId, id);

        List<PmsProductFullReduction> pmsProductFullReductions = productFullReductionMapper.selectList(queryWrapper);

        return pmsProductFullReductions;
    }

}




